<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        let obj = new Object();
        //定义属性
        obj.name= "杨杨";
        obj.age=22;
        //打印属性值
        // alert(obj.name+"     "+obj['age']);
        //删除属性的值
        delete obj.age;
        // alert(obj.name+"     "+obj.age);
        //定义一个speak方法
        obj.speak= function (){
            alert("hello");
        }
        //调用speak（)方法
        // obj.speak();
        //遍历对象中的所有属性名和属性值
        for (let fieldName in  obj){
            console.log("属性名: "+fieldName+"  属性值 "+obj[fieldName]);
        }
        //json对象的创建
        let man = {name:"杨杨",age:22,hobby:['吃鸡']};
        // alert(man.name+"   "+man.age+"   "+man.hobby);

        let array= [
            {code:"001",name:"李梅",age:26},
            {code:"002",name:"郑静",age:25},
            {code:"003",name:"呥智美",age:24},
            {code:"004",name:"肖美美",age:24},
            {code:"005",name:"木木",age:36},
        ];
        for (let i=0;i<array.length;i++){
            console.log(array[i].code+"   "+array[i].name+"   "+array[i].age);
        }


    </script>
</head>
<body>

</body>
</html>